package mysql

import "gorm.io/gorm"

type Order struct {
	gorm.Model
	UserId   int     `gorm:"type:int;not null;comment:用户id"`
	OrderSn  string  `gorm:"type:varchar(100);comment:订单号"`
	PayType  int     `gorm:"type:tinyint;comment:支付类型:1:支付宝;2:微信"`
	PayState int     `gorm:"type:tinyint;comment:支付状态:1:已支付;2:未支付;3:待支付;4:取消支付"`
	PayTime  int     `gorm:"type:tinyint(1);comment:支付时间"`
	Amount   float64 `gorm:"type:decimal(10,2);支付金额"`
}

func (o *Order) Create() error {
	return DB.Create(&o).Error
}
